<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.18"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>embedme: libemb::PThread Class Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectlogo"><img alt="Logo" src="logo.png"/></td>
  <td id="projectalign" style="padding-left: 0.5em;">
   <div id="projectname">embedme
   </div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.18 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
var searchBox = new SearchBox("searchBox", "search",false,'Search');
/* @license-end */
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
$(function() {
  initMenu('',true,false,'search.php','Search');
  $(document).ready(function() { init_search(); });
});
/* @license-end */</script>
<div id="main-nav"></div>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div id="nav-path" class="navpath">
  <ul>
<li class="navelem"><b>libemb</b></li><li class="navelem"><a class="el" href="classlibemb_1_1_p_thread.html">PThread</a></li>  </ul>
</div>
</div><!-- top -->
<div class="header">
  <div class="summary">
<a href="#nested-classes">Classes</a> &#124;
<a href="#pub-types">Public Types</a> &#124;
<a href="#pub-methods">Public Member Functions</a> &#124;
<a href="#pub-static-methods">Static Public Member Functions</a> &#124;
<a href="classlibemb_1_1_p_thread-members.html">List of all members</a>  </div>
  <div class="headertitle">
<div class="title">libemb::PThread Class Reference</div>  </div>
</div><!--header-->
<div class="contents">

<p>线程类 <br  />
  
 <a href="classlibemb_1_1_p_thread.html#details">More...</a></p>

<p><code>#include &lt;<a class="el" href="_thread_8h_source.html">Thread.h</a>&gt;</code></p>
<div class="dynheader">
Inheritance diagram for libemb::PThread:</div>
<div class="dyncontent">
 <div class="center">
  <img src="classlibemb_1_1_p_thread.png" usemap="#libemb::PThread_map" alt=""/>
  <map id="libemb::PThread_map" name="libemb::PThread_map">
<area href="classlibemb_1_1_thread.html" alt="libemb::Thread" shape="rect" coords="0,0,102,24"/>
  </map>
</div></div>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="nested-classes"></a>
Classes</h2></td></tr>
<tr class="memitem:"><td class="memItemLeft" align="right" valign="top">struct &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structlibemb_1_1_p_thread_1_1_thread_attr.html">ThreadAttr</a></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-types"></a>
Public Types</h2></td></tr>
<tr class="memitem:ac9d64b44a031321d4ab3a2790259bddd"><td class="memItemLeft" align="right" valign="top">enum &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classlibemb_1_1_p_thread.html#ac9d64b44a031321d4ab3a2790259bddd">SCHED_POLICY_E</a> { <a class="el" href="classlibemb_1_1_p_thread.html#ac9d64b44a031321d4ab3a2790259bddda09c71044114782eba011166cbce6e593">SCHED_POLICY_OTHER</a> = SCHED_OTHER, 
<a class="el" href="classlibemb_1_1_p_thread.html#ac9d64b44a031321d4ab3a2790259bddda539ad1068e9e17018e63246eb2ee1b3d">SCHED_POLICY_FIFO</a> = SCHED_FIFO, 
<a class="el" href="classlibemb_1_1_p_thread.html#ac9d64b44a031321d4ab3a2790259bddda22e3596e79010623b2761584dd92bf4b">SCHED_POLICY_RR</a> = SCHED_RR
 }</td></tr>
<tr class="separator:ac9d64b44a031321d4ab3a2790259bddd"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="inherit_header pub_types_classlibemb_1_1_thread"><td colspan="2" onclick="javascript:toggleInherit('pub_types_classlibemb_1_1_thread')"><img src="closed.png" alt="-"/>&#160;Public Types inherited from <a class="el" href="classlibemb_1_1_thread.html">libemb::Thread</a></td></tr>
<tr class="memitem:a2c53f1e58cdb42abdd892ec5c9f64bc9 inherit pub_types_classlibemb_1_1_thread"><td class="memItemLeft" align="right" valign="top"><a id="a2c53f1e58cdb42abdd892ec5c9f64bc9"></a>enum &#160;</td><td class="memItemRight" valign="bottom"><b>THREAD_STATE</b> { <b>STATE_INIT</b> =0, 
<b>STATE_START</b>, 
<b>STATE_RUNNING</b>, 
<b>STATE_EXIT</b>
 }</td></tr>
<tr class="separator:a2c53f1e58cdb42abdd892ec5c9f64bc9 inherit pub_types_classlibemb_1_1_thread"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-methods"></a>
Public Member Functions</h2></td></tr>
<tr class="memitem:a5ce3c7cbf40e3808380577d0f5d94485"><td class="memItemLeft" align="right" valign="top">std::unique_ptr&lt; <a class="el" href="classlibemb_1_1_thread.html">Thread</a> &gt;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classlibemb_1_1_p_thread.html#a5ce3c7cbf40e3808380577d0f5d94485">clone</a> () override</td></tr>
<tr class="memdesc:a5ce3c7cbf40e3808380577d0f5d94485"><td class="mdescLeft">&#160;</td><td class="mdescRight">克隆函数  <a href="classlibemb_1_1_p_thread.html#a5ce3c7cbf40e3808380577d0f5d94485">More...</a><br /></td></tr>
<tr class="separator:a5ce3c7cbf40e3808380577d0f5d94485"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aead2d7d699206b589e429a06cda8efd9"><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classlibemb_1_1_p_thread.html#aead2d7d699206b589e429a06cda8efd9">start</a> (const <a class="el" href="classlibemb_1_1_runnable.html">Runnable</a> &amp;runnable) override</td></tr>
<tr class="memdesc:aead2d7d699206b589e429a06cda8efd9"><td class="mdescLeft">&#160;</td><td class="mdescRight">启动线程  <a href="classlibemb_1_1_p_thread.html#aead2d7d699206b589e429a06cda8efd9">More...</a><br /></td></tr>
<tr class="separator:aead2d7d699206b589e429a06cda8efd9"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a55465daa7337b735c240359a1816e364"><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classlibemb_1_1_p_thread.html#a55465daa7337b735c240359a1816e364">stop</a> (int msTimeout=-1) override</td></tr>
<tr class="memdesc:a55465daa7337b735c240359a1816e364"><td class="mdescLeft">&#160;</td><td class="mdescRight">停止线程  <a href="classlibemb_1_1_p_thread.html#a55465daa7337b735c240359a1816e364">More...</a><br /></td></tr>
<tr class="separator:a55465daa7337b735c240359a1816e364"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a9aae9c9d37c8edee17e628505704cd3f"><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classlibemb_1_1_p_thread.html#a9aae9c9d37c8edee17e628505704cd3f">cancel</a> () override</td></tr>
<tr class="memdesc:a9aae9c9d37c8edee17e628505704cd3f"><td class="mdescLeft">&#160;</td><td class="mdescRight">强制退出线程  <a href="classlibemb_1_1_p_thread.html#a9aae9c9d37c8edee17e628505704cd3f">More...</a><br /></td></tr>
<tr class="separator:a9aae9c9d37c8edee17e628505704cd3f"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a7d0f9b8dbf1b0eeeffa2327041dff324"><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classlibemb_1_1_p_thread.html#a7d0f9b8dbf1b0eeeffa2327041dff324">isRunning</a> () override</td></tr>
<tr class="memdesc:a7d0f9b8dbf1b0eeeffa2327041dff324"><td class="mdescLeft">&#160;</td><td class="mdescRight">判断线程是否正在运行  <a href="classlibemb_1_1_p_thread.html#a7d0f9b8dbf1b0eeeffa2327041dff324">More...</a><br /></td></tr>
<tr class="separator:a7d0f9b8dbf1b0eeeffa2327041dff324"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a752d39d4eb36a988b9b24886886373d0"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classlibemb_1_1_p_thread.html#a752d39d4eb36a988b9b24886886373d0">setAttribute</a> (int policy, int priority, bool inherit=false, int stackSize=0)</td></tr>
<tr class="memdesc:a752d39d4eb36a988b9b24886886373d0"><td class="mdescLeft">&#160;</td><td class="mdescRight">设置线程属性  <a href="classlibemb_1_1_p_thread.html#a752d39d4eb36a988b9b24886886373d0">More...</a><br /></td></tr>
<tr class="separator:a752d39d4eb36a988b9b24886886373d0"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="inherit_header pub_methods_classlibemb_1_1_thread"><td colspan="2" onclick="javascript:toggleInherit('pub_methods_classlibemb_1_1_thread')"><img src="closed.png" alt="-"/>&#160;Public Member Functions inherited from <a class="el" href="classlibemb_1_1_thread.html">libemb::Thread</a></td></tr>
<tr class="memitem:ab5f10c487b08903f893cbf42d3fe51de inherit pub_methods_classlibemb_1_1_thread"><td class="memItemLeft" align="right" valign="top"><a id="ab5f10c487b08903f893cbf42d3fe51de"></a>
&#160;</td><td class="memItemRight" valign="bottom"><b>Thread</b> (const <a class="el" href="classlibemb_1_1_thread.html">Thread</a> &amp;copy)</td></tr>
<tr class="separator:ab5f10c487b08903f893cbf42d3fe51de inherit pub_methods_classlibemb_1_1_thread"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-static-methods"></a>
Static Public Member Functions</h2></td></tr>
<tr class="memitem:a90f937fa8c490b6df2c0f428598e88e4"><td class="memItemLeft" align="right" valign="top">static void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classlibemb_1_1_p_thread.html#a90f937fa8c490b6df2c0f428598e88e4">usleep</a> (int us)</td></tr>
<tr class="memdesc:a90f937fa8c490b6df2c0f428598e88e4"><td class="mdescLeft">&#160;</td><td class="mdescRight">微秒延时函数  <a href="classlibemb_1_1_p_thread.html#a90f937fa8c490b6df2c0f428598e88e4">More...</a><br /></td></tr>
<tr class="separator:a90f937fa8c490b6df2c0f428598e88e4"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aa0c044ad86e4305a515d53eba00fd914"><td class="memItemLeft" align="right" valign="top">static void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classlibemb_1_1_p_thread.html#aa0c044ad86e4305a515d53eba00fd914">msleep</a> (int ms)</td></tr>
<tr class="memdesc:aa0c044ad86e4305a515d53eba00fd914"><td class="mdescLeft">&#160;</td><td class="mdescRight">毫秒延时函数  <a href="classlibemb_1_1_p_thread.html#aa0c044ad86e4305a515d53eba00fd914">More...</a><br /></td></tr>
<tr class="separator:aa0c044ad86e4305a515d53eba00fd914"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a48db477652aa53f76eb71915bb0c786e"><td class="memItemLeft" align="right" valign="top">static bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classlibemb_1_1_p_thread.html#a48db477652aa53f76eb71915bb0c786e">initWithPreemptRT</a> (int policy, int priority)</td></tr>
<tr class="memdesc:a48db477652aa53f76eb71915bb0c786e"><td class="mdescLeft">&#160;</td><td class="mdescRight">初始化实时抢占系统  <a href="classlibemb_1_1_p_thread.html#a48db477652aa53f76eb71915bb0c786e">More...</a><br /></td></tr>
<tr class="separator:a48db477652aa53f76eb71915bb0c786e"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a67e79a3fcb3d211c66d5c5d13e1a2130"><td class="memItemLeft" align="right" valign="top"><a id="a67e79a3fcb3d211c66d5c5d13e1a2130"></a>
static void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classlibemb_1_1_p_thread.html#a67e79a3fcb3d211c66d5c5d13e1a2130">setCancelPoint</a> ()</td></tr>
<tr class="memdesc:a67e79a3fcb3d211c66d5c5d13e1a2130"><td class="mdescLeft">&#160;</td><td class="mdescRight">设置线程取消点 <br /></td></tr>
<tr class="separator:a67e79a3fcb3d211c66d5c5d13e1a2130"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="inherit_header pub_static_methods_classlibemb_1_1_thread"><td colspan="2" onclick="javascript:toggleInherit('pub_static_methods_classlibemb_1_1_thread')"><img src="closed.png" alt="-"/>&#160;Static Public Member Functions inherited from <a class="el" href="classlibemb_1_1_thread.html">libemb::Thread</a></td></tr>
<tr class="memitem:a3577f44fbdabce18815f6ca4578b6ef9 inherit pub_static_methods_classlibemb_1_1_thread"><td class="memItemLeft" align="right" valign="top">static void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classlibemb_1_1_thread.html#a3577f44fbdabce18815f6ca4578b6ef9">usleep</a> (int us)</td></tr>
<tr class="memdesc:a3577f44fbdabce18815f6ca4578b6ef9 inherit pub_static_methods_classlibemb_1_1_thread"><td class="mdescLeft">&#160;</td><td class="mdescRight">微秒延时函数  <a href="classlibemb_1_1_thread.html#a3577f44fbdabce18815f6ca4578b6ef9">More...</a><br /></td></tr>
<tr class="separator:a3577f44fbdabce18815f6ca4578b6ef9 inherit pub_static_methods_classlibemb_1_1_thread"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a05f5a8b508ca2ce08c66dd11e2734b82 inherit pub_static_methods_classlibemb_1_1_thread"><td class="memItemLeft" align="right" valign="top">static void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classlibemb_1_1_thread.html#a05f5a8b508ca2ce08c66dd11e2734b82">msleep</a> (int ms)</td></tr>
<tr class="memdesc:a05f5a8b508ca2ce08c66dd11e2734b82 inherit pub_static_methods_classlibemb_1_1_thread"><td class="mdescLeft">&#160;</td><td class="mdescRight">毫秒延时函数  <a href="classlibemb_1_1_thread.html#a05f5a8b508ca2ce08c66dd11e2734b82">More...</a><br /></td></tr>
<tr class="separator:a05f5a8b508ca2ce08c66dd11e2734b82 inherit pub_static_methods_classlibemb_1_1_thread"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ad670751a6bf2d419112e46c92fc527ae inherit pub_static_methods_classlibemb_1_1_thread"><td class="memItemLeft" align="right" valign="top">static int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classlibemb_1_1_thread.html#ad670751a6bf2d419112e46c92fc527ae">threadID</a> ()</td></tr>
<tr class="memdesc:ad670751a6bf2d419112e46c92fc527ae inherit pub_static_methods_classlibemb_1_1_thread"><td class="mdescLeft">&#160;</td><td class="mdescRight">获取当前代码所在线程ID  <a href="classlibemb_1_1_thread.html#ad670751a6bf2d419112e46c92fc527ae">More...</a><br /></td></tr>
<tr class="separator:ad670751a6bf2d419112e46c92fc527ae inherit pub_static_methods_classlibemb_1_1_thread"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="inherited"></a>
Additional Inherited Members</h2></td></tr>
<tr class="inherit_header pro_attribs_classlibemb_1_1_thread"><td colspan="2" onclick="javascript:toggleInherit('pro_attribs_classlibemb_1_1_thread')"><img src="closed.png" alt="-"/>&#160;Protected Attributes inherited from <a class="el" href="classlibemb_1_1_thread.html">libemb::Thread</a></td></tr>
<tr class="memitem:a7278379c88e913877e30508008dbb327 inherit pro_attribs_classlibemb_1_1_thread"><td class="memItemLeft" align="right" valign="top"><a id="a7278379c88e913877e30508008dbb327"></a>
<a class="el" href="classlibemb_1_1_runnable.html">Runnable</a> *&#160;</td><td class="memItemRight" valign="bottom"><b>m_pRunnable</b> {nullptr}</td></tr>
<tr class="separator:a7278379c88e913877e30508008dbb327 inherit pro_attribs_classlibemb_1_1_thread"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ab5d9f7142ce6b53e49f1e079e8615e82 inherit pro_attribs_classlibemb_1_1_thread"><td class="memItemLeft" align="right" valign="top"><a id="ab5d9f7142ce6b53e49f1e079e8615e82"></a>
bool&#160;</td><td class="memItemRight" valign="bottom"><b>m_runFlag</b> {false}</td></tr>
<tr class="separator:ab5d9f7142ce6b53e49f1e079e8615e82 inherit pro_attribs_classlibemb_1_1_thread"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a7dd7ea33f03f07052dbe2a3e11aa8f2d inherit pro_attribs_classlibemb_1_1_thread"><td class="memItemLeft" align="right" valign="top"><a id="a7dd7ea33f03f07052dbe2a3e11aa8f2d"></a>
int&#160;</td><td class="memItemRight" valign="bottom"><b>m_threadStatus</b> {STATE_INIT}</td></tr>
<tr class="separator:a7dd7ea33f03f07052dbe2a3e11aa8f2d inherit pro_attribs_classlibemb_1_1_thread"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<div class="textblock"><p>线程类 <br  />
 </p>
</div><h2 class="groupheader">Member Enumeration Documentation</h2>
<a id="ac9d64b44a031321d4ab3a2790259bddd"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ac9d64b44a031321d4ab3a2790259bddd">&#9670;&nbsp;</a></span>SCHED_POLICY_E</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">enum <a class="el" href="classlibemb_1_1_p_thread.html#ac9d64b44a031321d4ab3a2790259bddd">libemb::PThread::SCHED_POLICY_E</a></td>
        </tr>
      </table>
</div><div class="memdoc">
<table class="fieldtable">
<tr><th colspan="2">Enumerator</th></tr><tr><td class="fieldname"><a id="ac9d64b44a031321d4ab3a2790259bddda09c71044114782eba011166cbce6e593"></a>SCHED_POLICY_OTHER&#160;</td><td class="fielddoc"><p>0:普通调度策略,优先级只能设置为0 </p>
</td></tr>
<tr><td class="fieldname"><a id="ac9d64b44a031321d4ab3a2790259bddda539ad1068e9e17018e63246eb2ee1b3d"></a>SCHED_POLICY_FIFO&#160;</td><td class="fielddoc"><p>1:不同优先级抢占,同等优先级先进先出,优先级可以设置为1(低)~99(高) </p>
</td></tr>
<tr><td class="fieldname"><a id="ac9d64b44a031321d4ab3a2790259bddda22e3596e79010623b2761584dd92bf4b"></a>SCHED_POLICY_RR&#160;</td><td class="fielddoc"><p>2:不同优先级抢占,同等优先级均分时间片,优先级可以设置为1(低)~99(高) </p>
</td></tr>
</table>

</div>
</div>
<h2 class="groupheader">Member Function Documentation</h2>
<a id="a9aae9c9d37c8edee17e628505704cd3f"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a9aae9c9d37c8edee17e628505704cd3f">&#9670;&nbsp;</a></span>cancel()</h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">bool libemb::PThread::cancel </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">override</span><span class="mlabel">virtual</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>强制退出线程 </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">void</td><td></td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>void </dd></dl>

<p>Reimplemented from <a class="el" href="classlibemb_1_1_thread.html#a2b211bf8a128020705fad66e43ce9b5a">libemb::Thread</a>.</p>

</div>
</div>
<a id="a5ce3c7cbf40e3808380577d0f5d94485"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a5ce3c7cbf40e3808380577d0f5d94485">&#9670;&nbsp;</a></span>clone()</h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">std::unique_ptr&lt; <a class="el" href="classlibemb_1_1_thread.html">Thread</a> &gt; libemb::PThread::clone </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">override</span><span class="mlabel">virtual</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>克隆函数 </p>
<dl class="section return"><dt>Returns</dt><dd>std::unique_ptr&lt;Thread&gt; </dd></dl>

<p>Reimplemented from <a class="el" href="classlibemb_1_1_thread.html#a8d4fca9cb378d5331a1adf493ee0a6a1">libemb::Thread</a>.</p>

</div>
</div>
<a id="a48db477652aa53f76eb71915bb0c786e"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a48db477652aa53f76eb71915bb0c786e">&#9670;&nbsp;</a></span>initWithPreemptRT()</h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">bool libemb::PThread::initWithPreemptRT </td>
          <td>(</td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>policy</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>priority</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">static</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>初始化实时抢占系统 </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">policy</td><td></td></tr>
    <tr><td class="paramname">priority</td><td></td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>成功返回true,失败返回false </dd></dl>
<dl class="section note"><dt>Note</dt><dd>此函数仅限在linux-rt上使用 </dd></dl>

</div>
</div>
<a id="a7d0f9b8dbf1b0eeeffa2327041dff324"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a7d0f9b8dbf1b0eeeffa2327041dff324">&#9670;&nbsp;</a></span>isRunning()</h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">bool libemb::PThread::isRunning </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">override</span><span class="mlabel">virtual</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>判断线程是否正在运行 </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">void</td><td></td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>正在运行返回true,否则返回false </dd></dl>

<p>Reimplemented from <a class="el" href="classlibemb_1_1_thread.html#af1e236f2cb2cec6b64621d783696c73e">libemb::Thread</a>.</p>

</div>
</div>
<a id="aa0c044ad86e4305a515d53eba00fd914"></a>
<h2 class="memtitle"><span class="permalink"><a href="#aa0c044ad86e4305a515d53eba00fd914">&#9670;&nbsp;</a></span>msleep()</h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">void libemb::PThread::msleep </td>
          <td>(</td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>ms</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">static</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>毫秒延时函数 </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">ms</td><td>要延时的毫秒数 </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>void </dd></dl>
<dl class="section note"><dt>Note</dt><dd>函数休眠时,当前进程可能会让出CPU,引发进程调度 </dd></dl>

</div>
</div>
<a id="a752d39d4eb36a988b9b24886886373d0"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a752d39d4eb36a988b9b24886886373d0">&#9670;&nbsp;</a></span>setAttribute()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void libemb::PThread::setAttribute </td>
          <td>(</td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>policy</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>priority</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">bool&#160;</td>
          <td class="paramname"><em>inherit</em> = <code>false</code>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>stackSize</em> = <code>0</code>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>设置线程属性 </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">policy</td><td></td></tr>
    <tr><td class="paramname">priority</td><td></td></tr>
    <tr><td class="paramname">inherit</td><td></td></tr>
    <tr><td class="paramname">stackSize</td><td></td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a id="aead2d7d699206b589e429a06cda8efd9"></a>
<h2 class="memtitle"><span class="permalink"><a href="#aead2d7d699206b589e429a06cda8efd9">&#9670;&nbsp;</a></span>start()</h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">bool libemb::PThread::start </td>
          <td>(</td>
          <td class="paramtype">const <a class="el" href="classlibemb_1_1_runnable.html">Runnable</a> &amp;&#160;</td>
          <td class="paramname"><em>runnable</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">override</span><span class="mlabel">virtual</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>启动线程 </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">runnable</td><td>Runnable对象 </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>成功返回true,失败返回false </dd></dl>

<p>Reimplemented from <a class="el" href="classlibemb_1_1_thread.html#a2e0f619868ec15de65c7940dcc94dba0">libemb::Thread</a>.</p>

</div>
</div>
<a id="a55465daa7337b735c240359a1816e364"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a55465daa7337b735c240359a1816e364">&#9670;&nbsp;</a></span>stop()</h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">bool libemb::PThread::stop </td>
          <td>(</td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>msTimeout</em> = <code>-1</code></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">override</span><span class="mlabel">virtual</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>停止线程 </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">msTimeout</td><td>超时时间 </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>成功返回true,失败返回false </dd></dl>

<p>Reimplemented from <a class="el" href="classlibemb_1_1_thread.html#a3ba546547e2f82a1b908124ff511e97b">libemb::Thread</a>.</p>

</div>
</div>
<a id="a90f937fa8c490b6df2c0f428598e88e4"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a90f937fa8c490b6df2c0f428598e88e4">&#9670;&nbsp;</a></span>usleep()</h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">void libemb::PThread::usleep </td>
          <td>(</td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>us</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">static</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>微秒延时函数 </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">us</td><td>要延时的微秒数 </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>void </dd></dl>
<dl class="section note"><dt>Note</dt><dd>函数休眠时,当前进程可能会让出CPU,引发进程调度 注意使用usleep时,时间不能设置得太短,否则调度时 进程间切换太频繁非常耗资源!!!推荐最小值为100us </dd></dl>

</div>
</div>
<hr/>The documentation for this class was generated from the following files:<ul>
<li>src/<a class="el" href="_thread_8h_source.html">Thread.h</a></li>
<li>src/Thread.cpp</li>
</ul>
</div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.18
</small></address>
</body>
</html>
